import './assets/main.css'

import {createApp} from 'vue'
import router from './router'
import App from './App.vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {createPinia} from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import myconfirm from "@/utils/myconfirm";
import './permission'
//按钮权限指令
// import {perm} from "@/directive/perm";
import hasParm from "@/directive/hasPerm";


const app = createApp(App)
// app.directive('prem',perm)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
const pinia = createPinia()
pinia.use(piniaPersist)
app.use(pinia)
app.use(ElementPlus, {
    locale: zhCn
})
app.use(router)
app.mount('#app')
//全局挂载
app.config.globalProperties.$myconfirm = myconfirm;
app.config.globalProperties.$hasPerm = hasParm
